<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="password-Type" password="text/html; charset=UTF-8">
<title>护工预览</title>
<link
	href="${pageContext.request.contextPath}/css/bootstrap.min.css?v=3.3.5"
	rel="stylesheet">
<link
	href="${pageContext.request.contextPath}/css/font-awesome.min.css?v=4.4.0"
	rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/custom.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/animate.min.css"
	rel="stylesheet">
<link
	href="${pageContext.request.contextPath}/css/style.min.css?v=4.0.0"
	rel="stylesheet">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<style type="text/css">
label {
	display: inline-block;
	padding: 0 10px;
	vertical-align: middle;
}

input {
	outline: none;
	border: 1px solid rgb(216, 216, 216);
	padding: 2px 10px 2px 10px;
}

input[type="text"],input[type="password"] {
	height: 30px;
	line-height: 30px;
	border-radius: 5px;
	padding: 0px 10px;
	vertical-align: middle;
	color: #666;
}

input[type="button"] {
	padding: 0px 10px;
	height: 40px;
}

.form-group {
	vertical-align: middle;
	padding: 10px 10px;
}

.text-center-1 {
	text-align: right;
}

.loginscreen.middle-box {
	width: 600px;
}
</style>

<script type="text/javascript">
		$(document).ready(function() {
			$(".i-checks").iCheck({
				checkboxClass : "icheckbox_square-green",
				radioClass : "iradio_square-green",
			});
		});
</script>
<script type="text/javascript">
      function deletefun(id,newName){
         if(confirm("确定要导出excel表?")){
            window.location.href="${pageContext.request.contextPath}/servlet/HugongServlet?path=dc";
         }
      }
     function deletefun1(id,newName){
         if(confirm("确定要导入excel表?")){
            window.location.href="${pageContext.request.contextPath}/servlet/HugongServlet?path=dr";
         }
      }
    </script>
<script type="text/javascript">
$(document).ready(function() {
	dayin();
});
function dayin(){
	bdhtml=window.document.body.innerHTML;//获取当前页的html代码  
	sprnstr="<!--startprint-->";//设置打印开始区域  
	eprnstr="<!--endprint-->";//设置打印结束区域  
	prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+0); //从开始代码向后取html  
	prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html 
	window.document.body.innerHTML=prnhtml;  
	window.print();  
}
</script>
</head>

<body class="gray-bg">
<!--startprint-->
<h1>护工预览</h1>
	<br/>
	
			<form method="post"
					action="${pageContext.request.contextPath }/Hugong/page"
					 onsubmit="return validate()">
				<div class="form-group">
					<label for="" class="col-sm-4 control-label">账号名称</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" id=""
							name="name" value="">
					</div>
					<label for="" id="realname_prompt"
						class="col-sm-12 control-label text-center-1"></label>
				</div>
				<div class="form-group">
					<label for="" class="col-sm-4 control-label">护工名称</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" id=""
							name="realname" value="">
					</div>
					<label for="" id="realname_prompt"
						class="col-sm-12 control-label text-center-1"></label>
				</div>
				<div class="form-group">
					<label for="" class="col-sm-4 control-label">联系方式</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" id=""
							name="phone" value="">
					</div>
					<label for="" id="realname_prompt"
						class="col-sm-12 control-label text-center-1"></label>
				</div>
				<br />
				<div class="form-group">
					<input type="submit" class="btn btn-primary block full-width m-b"
						value="查询" />
				</div>
			</form>
	
	
    <table style="margin:0 auto;" class="display table table-bordered table-striped"
					id="dynamic-table">
      <tr>
         <td>编号</td>
         <td>账号</td>
         <td>护工名称</td>
         <td>联系方式</td>
         <td>护工头像介绍</td>
         <td>护工地址</td>
         <td>年龄</td>
         <td>性别</td>
         <td>介绍</td>
         <td>角色</td>
         <td>操作</td>
      </tr>
      <c:forEach items="${pageUtil.getList() }" var="p">
         <tr>
         <td>${p.id }</td>
         <td>${p.name }</td>
         <td>${p.realname }</td>
         <td>${p.phone }</td>
         <td>
         	<img src="${pageContext.request.contextPath}/upload/${p.picture }" width="100" height="100"></img>
         </td>
         <td>${p.address }</td>
         <td>${p.age }</td>
         <td>${p.sex }</td>
         <td>${p.introduce }</td>
         <td>
         	<c:if test="${p.zt == 1 }">普通员工</c:if>
         </td>
         <td align="center" style="width:200px">
	        <a href="${pageContext.request.contextPath}/Hugong/delete/${p.id}"><button class="btn btn-default" onclick="">删除</button></a>
	     </td>
         </tr>
      </c:forEach> 
    </table>
    <br/>
    <input type="submit" class="btn btn-primary block full-width m-b"
						value="护工管理操作列表" />
	<br/><br/>
	<table style="width:100%">
	<tr>
	<td align="center">
				<b>共${pageUtil.pageNumber}</b>条&nbsp;&nbsp;&nbsp;&nbsp;
				当前第<span>${pageUtil.pageIndex}</span>页&nbsp;&nbsp;&nbsp;&nbsp;
               	<a href="${pageContext.request.contextPath}/Hugong/page?pageIndex=1" class='first'>首页</a>
               	&nbsp;&nbsp;&nbsp;&nbsp; 
                <a href="${pageContext.request.contextPath}/Hugong/page?pageIndex=${pageUtil.pageIndex>1?pageUtil.pageIndex-1:1}" class='pre'>上一页</a>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <c:forEach begin="1" end="${pageUtil.pageCount}" var="i">  
                <a href="${pageContext.request.contextPath}/Hugong/page?pageIndex=${i}" style="text-decoration: none;">${i}</a>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </c:forEach>
                <a href="${pageContext.request.contextPath}/Hugong/page?pageIndex=${pageUtil.pageIndex<pageUtil.pageCount?pageUtil.pageIndex+1:pageUtil.pageCount}" class='next'>下一页</a>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <a href="${pageContext.request.contextPath}/Hugong/page?pageIndex=${pageUtil.pageCount}" class='last'>末页</a>
                
				
		</td>		
		</tr>
	</table>
	<br/><br/>
	<br/><br/>
	<br/><br/>
</body>


</html>